package com.wangijun.yuan.core.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wangijun.yuan.core.base.YesNoEnum;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 私信记录表
 */
@Schema(description = "私信记录表")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "chat_info")
public class ChatInfo implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private Long id;

    /**
     * 发送消息人ID
     */
    @TableField(value = "send_user_id")
    @Schema(description = "发送消息人ID")
    private Long sendUserId;

    /**
     * 接收消息人ID
     */
    @TableField(value = "receive_user_id")
    @Schema(description = "接收消息人ID")
    private Long receiveUserId;

    /**
     * 消息类型
     */
    @TableField(value = "msg_type")
    @Schema(description = "消息类型")
    private Integer msgType;

    /**
     * 消息内容
     */
    @TableField(value = "msg")
    @Schema(description = "消息内容")
    private String msg;

    /**
     * 发送时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(description = "发送时间")
    private LocalDateTime createTime;

    /**
     * 是否已读0未读,1已读
     */
    @TableField(value = "read_flag")
    @Schema(description = "是否已读0未读,1已读")
    private YesNoEnum readFlag;
    @Serial
    private static final long serialVersionUID = 1L;
}